package cn.platform.mapper;

import cn.platform.entity.Activity;
import cn.platform.response.ActivityVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface ActivityAdminMapper {
    Page<ActivityVO> pageQuery(@Param("map") Map<String, Object> map);

    /**
     * 根据id查询活动
     * @param id
     * @return
     * @author oyq
     */
    @Select("select * from jxt_stu_how_act where id=#{id}")
    Activity getById(String id);

    // 更新，用id找，其余参数为更新内容，null值不更新
    void updateActivity(Activity activity);

    /**
     * 根据id删除单条记录
     * @param id
     */
    @Delete("delete from jxt_stu_how_act where id=#{id}")
    void deleteById(Integer id);

    /**
     * 根据id批量删除记录
     * @param ids
     */
    void deleteBatch(List<Integer> ids);
}
